package com.hx.springboot.dome01.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Desc: 用户实体
 * @Author: HanX
 * @Date: 2022/5/14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
//映射数据库表 默认情况下 会把实体类作为数据库表名区映射
@TableName("t_reader")
public class ReaderInfo {
    //表示主键   type= IdType.AUTO 表示主键自增
    @TableId(type= IdType.AUTO)
    private Integer id;

    private String  readerNum;
    private String readerName;
    private String password;
    private Integer gender;
    @DateTimeFormat(pattern = "yyyy-mm-dd")
    private Date birth;
    private String address;
    private String phone;
    private Date createTime;
    private Date updateTime;
    private Integer adminId;
    private Integer status;
    //表示当前属性在数据库表中没有相对应的字段
//    @TableField(exist = false)
//    private Admin admin;
    //查询时 不查询该属性对应的字段
//    @TableField(select = false)
//    private Date createTime;
}
